// *** LICENSE HEADER ***
// Filename: ./definitions.h
// This file is part of Nodewarz 0.1
// Nodewarz is a 3d OpenGL strategy game
// Copyright (C) 2007 CZestmyr
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this program; if not, write to the Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
// *** END LICENSE HEADER ***
#ifndef NODEWARS_DEFINITIONS_H
#define NODEWARS_DEFINITIONS_H

//Width of the screen
#define _WIDTH 1024
//Height of the screen
#define _HEIGHT 768
//Bits per pixel
#define _BPP 16
//Bits per color
#define _BPC 5
//Game font size
#define _FONT_SIZE 22
//Menu font size
#define _FONT_SIZE_MENU 14

//Coefficient for computing radians from degrees
#define _DEG2RAD 0.0174532925199433f
//Inverse value of the euler's number
#define _EULER_INVERSE 0.3678794411714423f

//Texture filtering method
//GL_NEAREST is quick but ugly
//GL_LINEAR is nice but slow
#define _TEXTURE_FILTER GL_LINEAR

//Speed of the rotation of camera
#define _CAMERA_ROT_SPEED 0.2f
//Speed of the vertical camera rotation
#define _CAMERA_VERT_ROT_SPEED 0.1f
//Upper vertical camera rotation restraint
#define _CAMERA_MAX_VERT 89.0f
//Lower vertical camera rotation restraint
#define _CAMERA_MIN_VERT 5.0f
//Upper camera zoom restraint
#define _CAMERA_MAX_Z 100.0f
//Lower camera zoom position restraint
#define _CAMERA_MIN_Z 1.0f
//Camera acceleration
#define _CAMERA_ZOOM_ACCEL 0.00012f
//Camera max zoom speed
#define _CAMERA_MAX_ZOOM_SPEED 0.035f
//Camera friction
#define _CAMERA_FRICTION 0.00006f

//Cost of connections
#define _CONNECTION_COST_MODIFIER 1.6f
//Minimum distance between friendly nodes
#define _MINDIST_FRIENDLY 2.0f
//Minimum distance between enemy nodes
#define _MINDIST_ENEMY 3.0f
//Radius of the area, where a resource is active (should be less than _MINDIST_FRIENDLY / 4.0)
#define _RESOURCE_RADIUS 0.4f

//Particle emitter templates
#define _PET_FIRE 1
#define _PET_SMOKE 2
#define _PET_FOUNTAIN 3
#define _PET_POWERSPHERE 4
#define _PET_PSIBURST 5
#define _PET_FIRE_IMMORTAL 6
#define _PET_SPHERE_IMMORTAL 7
#define _PET_PSIBURST_IMMORTAL 8
#define _PET_DOLLARS 9
#define _PET_OTHER 0

//Ambient lighting color of terrain
#define _TERRAIN_AMBIENT_COLOR 0.17f

#define _DEBUG

//Some constants for sender/receiver
#define _SEREC_MAX_MESSAGE_LENGTH 250
#define _SEREC_MAX_PACKET_SIZE 256

//Connector hi packet
#define _CONNECTOR_HI 0
//Connector disconnection request packet
#define _CONNECTOR_BYE 1
//Connector heartbeat packet
#define _CONNECTOR_HBT 2
//Connector chat message packet
#define _CONNECTOR_MSG 3
//Connector game event packet
#define _CONNECTOR_EVT 4
//Connector server full packet
#define _CONNECTOR_FULL 5

//Time, the server has for answering a connection request
#define _CONNECTOR_SERVER_RESPONSE_TIME 10000

//Delay for the connector client before sending another heartbeat in milliseconds
#define _CONNECTOR_HEARTBEAT_DELAY 7000
//Timeout time for the connector server to disconnect the client in milliseconds
#define _CONNECTOR_HEARTBEAT_TIMEOUT 20000

//Some connector event definitions

//Sent to clients when a client list changes
#define _CONNECTOR_EVENT_CLIENTLIST 1
//Sent to clients when a client list changes
#define _CONNECTOR_EVENT_CHANGENAME 2
//Sent to clients when a client name list changes
#define _CONNECTOR_EVENT_CLIENTNAMELIST 3
//Sent to clients when they need to update their player lists
#define _CONNECTOR_EVENT_PLISTCHANGE 4
//Used to inform the clients of new playerdata
#define _CONNECTOR_EVENT_PDATA 5
//Used to inform the clients of a new game start
#define _CONNECTOR_EVENT_STARTGAME 6
//Tells the other clients to create a node
#define _CONNECTOR_EVENT_CREATENODE 7
//Tells the other clients to connect two nodes
#define _CONNECTOR_EVENT_CONNECTNODES 8
//Ends your turn
#define _CONNECTOR_EVENT_ENDTURN 9
//Sets your player data correctly on other clients
#define _CONNECTOR_EVENT_PLAYERDATA 10
//Sent after a successful attack
#define _CONNECTOR_EVENT_ATTACK 11
//Sent after a successful defence
#define _CONNECTOR_EVENT_DEFEND 12
//Sent after unsuccessful attack
#define _CONNECTOR_EVENT_IMPATTACK 13
//Sent after unsuccessful defence
#define _CONNECTOR_EVENT_IMPDEFENCE 14
//Sent after successful takeover attack
#define _CONNECTOR_EVENT_TAKEOVERATTACK 15
//Sent after successful takeover defence
#define _CONNECTOR_EVENT_TAKEOVERDEFENCE 16
//Sent after unsuccessful takeover
#define _CONNECTOR_EVENT_IMPTAKEOVER 17
//Sent after node dissintegration
#define _CONNECTOR_EVENT_DISSINTEGRATE 18

//Time that has to elapse before server sends updated player data to clients
#define _ROSTER_PLAYERDATA_TIME 5000

//Number of messages that the viewer is capable of viewing simultaneously
#define _MESSAGEVIEWER_NUMBER 5
//Life length of one message (if not removed by newer)
#define _MESSAGEVIEWER_TIMEOUT 15000
//Message viewer font size
#define _MESSAGEVIEWER_FONTSIZE 16
//Message viewer message buffer size
#define _MESSAGEVIEWER_BUFSIZE 256

//Canvas texture dimensions
#define _CANVAS_TSX 160
#define _CANVAS_TSY 160

#endif
